Think, explore, & write about what the co-evolutionary interaction between newts & snakes with different genetic architectures (GAs, combination of mutation rate & mutation effect size) can lead to. This markdown is investigation what is up with the different levels of correlation between rectangles and squares. After fixing the row vs column error I looked at the correlation data and found that there was less correlation. So I decided to investigate why that might be and run a few more experiments. I am running an experiment to test how changing the square size might impact the calculations. I also plan on changing the interaction rate (but want to look at the math/ feasibility of it). This file contains results discussed in Tall_GA1!
What does it mean to be correlated?
I investigated the correlations between snake and newt phenotypes at the local grid locations along with population level phenotype. I found there was a lot of correlation when populations slowly adapt! However, after a closer investigation I found that these correlations were from a rectangle shaped area and not a square one. Here, I rerun the experiment with he correct square grids and discuss how the results differ. I also aim to investigate how changing the area/shape of the grids will influence correlation results. I am also thinking of ways to gather and incorperate allele information.
I created a simulation study to observe the co-evolutionary outcome of the newt-snake interaction with different genetic architectures (GAs) in a spatial setting. I hypothesized that we would see an interaction (co-evolutionary arms race) between newt and snake phenotype under some GA combinations when newts and snakes were evolving over geographical space. Each GA is paired with another GA creating 16 combinations.
GA1 experiment values:
Landscape: 20 by 5 grid. A tall map!: 354 H, 35 W New Landscape 28 by 7 grid: 354 H, 35 W
I gather text file data from different files and have to do some table wrangling to get it into a format I can graph. I use information gathered from the entire population; data containing a mean value for the entire map (lit), correlation data based off of local populations that were divided into grids (cor) and data collected from grid based populations (grid). These simulations have a msprime (coalescent/burn in/random genetic variation) and then run for 50,000 generations in SLiM (co-evolution) (all with the same GA values). I run 4 trials for every GA combination and try two different grid sizes 20 by 5 (large) and 24 by 7 (small) in SLiM. These slim simulations use the same msprime simulation, but can statistically be different.
## All cor, lit, and grid files exist!
## This program will now end!
Important files GA1_tall_tall_file GA1_cor_tall_file GA1_grid_tall_file GA1_tall_tall_7_file GA1_cor_tall_7_file GA1_grid_tall_7_file
First, I will look at a plot of how the mean phenotype of the entire population of newts and snakes changes overtime. Each of these plots has three colored lines, red for the mean newt phenotype, blue for the mean snake phenotype, and black for the difference between mean snake and mean newt phenotype. There are 4 line per color that represent the different replicas that I ran. Note this is a mean for the entire population. Mutational variance increases for the snakes as you go down the figure (top to bottom) and increases for the newts as you go across (left to right).
## Group.1 x
## 1 1e-08_0.005_1e-08_0.005 0.1228741
## 2 1e-08_0.005_1e-09_0.05 -1.9048949
## 3 1e-08_0.005_1e-10_0.5 -2.8179176
## 4 1e-08_0.005_1e-11_5 -0.4003216
## 5 1e-09_0.05_1e-08_0.005 2.7018939
## 6 1e-09_0.05_1e-09_0.05 -0.5188002
## 7 1e-09_0.05_1e-10_0.5 -1.1922474
## 8 1e-09_0.05_1e-11_5 0.4028800
## 9 1e-10_0.5_1e-08_0.005 1.8949091
## 10 1e-10_0.5_1e-09_0.05 -0.2873013
## 11 1e-10_0.5_1e-10_0.5 -0.4165329
## 12 1e-10_0.5_1e-11_5 0.3512759
## 13 1e-11_5_1e-08_0.005 0.1343393
## 14 1e-11_5_1e-09_0.05 -1.2582723
## 15 1e-11_5_1e-10_0.5 -1.3798476
## 16 1e-11_5_1e-11_5 -0.6589529
## Group.1 x
## 1 1e-08_0.005_1e-08_0.005 0.13112840
## 2 1e-08_0.005_1e-09_0.05 -2.39679271
## 3 1e-08_0.005_1e-10_0.5 -2.73768918
## 4 1e-08_0.005_1e-11_5 -0.25055622
## 5 1e-09_0.05_1e-08_0.005 2.61270891
## 6 1e-09_0.05_1e-09_0.05 -0.70695433
## 7 1e-09_0.05_1e-10_0.5 -1.14717140
## 8 1e-09_0.05_1e-11_5 0.38920777
## 9 1e-10_0.5_1e-08_0.005 2.10180688
## 10 1e-10_0.5_1e-09_0.05 -0.08745614
## 11 1e-10_0.5_1e-10_0.5 -0.36972292
## 12 1e-10_0.5_1e-11_5 0.43034445
## 13 1e-11_5_1e-08_0.005 0.56986732
## 14 1e-11_5_1e-09_0.05 -1.26474530
## 15 1e-11_5_1e-10_0.5 -1.46086858
## 16 1e-11_5_1e-11_5 -0.82308506
Notes
Notes
I looked at the results between 5,000 - 10,000 generations where I saw most of the increase in newt and snake phenotype. The first plot has newt population size by snake population size with the color representing the difference between snake and newt mean phenotype (red=newts have a higher mean phenotype, blue=snakes have a higher mean phenotype). The third GA (an intermediate one) seems to do better then all of the other GAs (blue row (3), red column (3)). However, this is dependent on the point in the simulation you focus on. The next two plots show the difference between snake and newt population size (green) and phenotype (purple). For the most part these suggest that when the mean phenotype is higher so is the population size. This also shows the asymmetrical nature between the predator-prey interaction (higher max population sizes seen in snakes). The population size is also more variable than the phenotype (difference in population size has a wider range).
The next section I aim to look at how correlated newt and snakes are at local populations across the geographical area. I am examining correlation between newt and snake phenotypes, population sizes of newts and snakes, amount of toxin and snake population, and the amount of resistance and newt population size. I predicted that there would be a positive correlation between the phenotypes, and a negative correlation between population sizes, and the amount of toxin/resistance and population size. Below is a legend for the first two plots. The third plot is colored by trial.
I first look at the correlation between mean newt phenotype and mean snake phenotype for each of the four trials in every GA combination from 10,000-15,000 generations. The solid line is a 0 with a dashed line at the level of correlation seen in natural newt-snake population(s). The second figure shows the the results of all 4 trials for each correlation measurement I made from 10,000-15,000 generations. The third plot takes the information from the fist plot and shows the distribution of correlation values by each trial (solid line at 0, dashed line at real newt-snake correlation).
After looking at this figure, I can see that there is a larger range of correlation values. The can sometimes be positive, near 0, or negative. Very few reach (or come near) the real newt-snake correlation. How do you find the correct time slice to look for spatial correlation? How would these phenotypes become spatially correlated and then become not spatially correlated.
In order to understand how spatial correlations where changing with time I took 5,000 generation time slices to look at all four trials correlation values. Each color is a different trial per GA combination. The histogram values are stacked.
In order to understand how spatial correlations where changing with time I took 5,000 generation time slices to look at all four trials correlation values. Each color is a different trial per GA combination. The histogram values are stacked.
notes
## [1] "pattern 1e-11_5_1e-10_0.5_1"
## [1] "Cor between average snake pheno and local cor -0.0314060463750889"
## [1] "Cor between average newt pheno and local cor 0.00810297374558884"
## [1] "Cor between average dif pheno and local cor -0.0648198431335265"
## [1] "Cor between newt pheno and snake 0.811525316090738"
## [1] "pattern 1e-08_0.005_1e-08_0.005_1"
## [1] "Cor between average snake pheno and local cor 0.3733304670777"
## [1] "Cor between average newt pheno and local cor 0.326696896375133"
## [1] "Cor between average dif pheno and local cor 0.361899546136465"
## [1] "Cor between newt pheno and snake 0.795578851089615"
## [1] "pattern 1e-09_0.05_1e-11_5_3"
## [1] "Cor between average snake pheno and local cor 0.426885987029011"
## [1] "Cor between average newt pheno and local cor 0.37727850183199"
## [1] "Cor between average dif pheno and local cor 0.0213990051869683"
## [1] "Cor between newt pheno and snake 0.948882972249104"
## [1] "pattern 1e-09_0.05_1e-11_5_1"
## [1] "Cor between average snake pheno and local cor 0.00738423923360094"
## [1] "Cor between average newt pheno and local cor -0.0812305838120983"
## [1] "Cor between average dif pheno and local cor 0.218035609626229"
## [1] "Cor between newt pheno and snake 0.914869435565593"
## [1] "pattern 1e-09_0.05_1e-08_0.005_0"
## [1] "Cor between average snake pheno and local cor -0.113606417425076"
## [1] "Cor between average newt pheno and local cor 0.114932002305195"
## [1] "Cor between average dif pheno and local cor -0.154973656506681"
## [1] "Cor between newt pheno and snake 0.333820567947072"
This next section is just getting a glimpse at how newt & snake phenotype and population size differ over time. The populations start off with about 250 individuals each. Each individual has a different genetic background created from msprime.
This next section is just getting a glimpse at how newt & snake phenotype and population size differ over time. The populations start off with about 250 individuals each. Each individual has a different genetic background created from msprime.
explane
notes
notes
expla
notes
notes
file_name= “Snake_1e-09_0.05_Newt_1e-09_0.05_2” file_name= “Snake_1e-08_0.005_Newt_1e-08_0.005_3” file_name= “Snake_1e-09_0.05_Newt_1e-09_0.05_2”
notes
## [1] 0.4282603
## [1] -0.05794028
## [1] 0.4025511
## [1] 0.242993
## [1] -0.2920976
## [1] -0.0140173
## [1] 0.2180298
## [1] 0.1438674
## [1] 0.01899735
## [1] 0.3874851
## [1] 0.30277
## [1] 0.2940706
## [1] 0.3301998
## [1] 0.3831788
## [1] 0.5742363
notes
## [1] 0.4031636
## [1] -0.04149063
## [1] 0.2860037
## [1] 0.2452591
## [1] -0.2656185
## [1] 0.1251775
## [1] 0.1103881
## [1] 0.0716194
## [1] 0.1474161
## [1] 0.1387545
## [1] 0.2668241
## [1] 0.1280909
## [1] 0.2194371
## [1] 0.3367974
## [1] 0.2845694